<?php

include 'libs/main.php';

  dl(stristr (PHP_OS, "WIN") ? "php_gtk.dll" : "php_gtk.so");

  function delete_event()
        {
    	return false;
        }
  
  function cerrar()
        {
    	Gtk::main_quit();
        }

  $mysql = mysql_connect($mysql_db,$mysql_user,$mysql_password);
  
  if (!$mysql) 
  		{
		die('No pudo conectarse: ' . mysql_error());
		}      
        
  function hola()
        {
    	global    $ventana;
    	print "Hola Mundo!\n";
    	$ventana->cerrar();
        } 

  $ventana = &new GtkWindow();
  $ventana>connect('destroy', 'cerrar');
  $ventana>connect('delete-event', 'delete_event');
  $ventana>set_border_width(10); 

  $boton = &new GtkButton('Hello World!');
  $boton>connect('clicked', 'hello');
  $ventana>add($button);
  
  $tt = &new GtkTooltips();
  $tt->set_delay(200);
  $tt->set_tip($button, 'Hola mundo', '');
  $tt->enable();

  $ventana->show_all();
  Gtk::main();

        
  mysql_close($mysql);
        
?> 